#ifndef _AUCTIONEERMGR_H
#define _AUCTIONEERMGR_H

#include "base/core/singleton.h"
#include <stdint.h>
#include <unordered_map>
#include <string>
#include <vector>
#include "base/core/char_operation.h"
#include "Common/MessageDispatch/IMessageDispatch.h"
#include "Common/CharacterDefine.h"

using namespace std;
class ItemBase;
//拍卖行,这里只做消息转发，验证一些人物信息
class CAuctioneerMgr : public IServerMessageHandler, public IClientMessageHandler, public ManualSingleton < CAuctioneerMgr >
{
public:
	friend class ManualSingleton < CAuctioneerMgr >;
	CAuctioneerMgr();
	virtual ~CAuctioneerMgr();

	bool Init();
	void UnInit();

	//////////////////////////////  IServerMessageHandler ////////////////////////////////////////////
	virtual void		onServerMessage(uint32_t actionId, RECV_PACKAGE &package);
	virtual const char* getServerHandlerDebugInfo(void){ return "SystemModule::onServerMessage"; }
	//////////////////////////////  IClientMessageHandler ////////////////////////////////////////////
	virtual void		onClientMessage(uint32_t actionId, RECV_PACKAGE& package, uint64_t Id = 0);
	virtual const char* getClientHandlerDebugInfo(void){ return "LogicSystemModule::onClientMessage"; }
	//////////////////////////////IDBProxyMessageHandler 
	//virtual void		onDBProxyMessage(uint32_t actionId, RECV_PACKAGE &package);
	//virtual const char* getDBProxyHandlerDebugInfo(void) { return "LogicSystemModule::onDBProxyMessage"; }

	//test
	void AddTestItemToDB(CharIDType playerCid);
public: //客户端来的消息
	void OnSaleItem(RECV_PACKAGE &package);
public: //中心服来的消息
	void OnReduceMoney(RECV_PACKAGE &package);
	void OnSaleItemResult(RECV_PACKAGE &package);
};



#define g_MakeAuctioneerMgr() (CAuctioneerMgr::Instance())
#define g_GetAuctioneerMgr()  (CAuctioneerMgr::GetInstance())
#define g_DelAuctioneerMgr()  (CAuctioneerMgr::Destroy())

#endif // !_AUCTIONEERMGR_H
